package com.wyh.product.api;

import com.wyh.product.model.ProductInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "product-service",path = "product")
public interface OpenFeignAPI {
    @RequestMapping("/{productId}")
    ProductInfo selectProductById(@PathVariable("productId")Integer productId);

    @RequestMapping("/p1")
    public String p1 (@RequestParam("s") String s);

    @RequestMapping("p2")
    public String p2 (@RequestParam("s") String s, @RequestParam("i") Integer i);

    @RequestMapping("p3")
    public String p3 (@SpringQueryMap ProductInfo p);

    @RequestMapping("p4")
    public String p4 (@RequestBody ProductInfo p);
}
